package com.xlh.enums;

import com.xlh.enums.user.RoleEnum;

/**
 * @author sy
 */
public enum PcConfigEnum {

    PC_CONFIG_OPEN(false,"开"),

    PC_CONFIG_CLOSE(true,"关");

    private Boolean code;

    private String message;

    PcConfigEnum(Boolean code,String message){
        this.code = code;
        this.message = message;
    }



    public Boolean getCode() {
        return code;
    }

    public void setCode(Boolean code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String codeToName(Integer code) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.getRoleCode() == code) {
                return roleEnum.name().toUpperCase();
            }
        }
        return null;
    }
}
